import React, { useState, useEffect } from 'react'

import SvgIcon from '../common/svg-icon'
import common from '../../store/common'

const MoreBtn = () => {
  const { event$ } = common

  const [visible, setVisible] = useState(false)

  useEffect(() => {
    event$.emit({ action: 'showMoreInfo', val: visible })
  }, [visible])

  return <SvgIcon icon="#iconmore" handleClick={() => setVisible(!visible)} />
}

export default MoreBtn
